/**
 * 单选框变成 iphone样式 
 */
define(function(require, exports, module){
    var $ = require("jquery");
    var Tutorial = function(options){
        this.options = {
            "position" : "fixed",
            "width" : 200,
            "height" : "auto",
            "top" : 150,
            "right" : 15,
            "template" : ''
        }
        if(options){
            $.extend(this.options,options);
        }
        this._tutorialInit();
    };
    Tutorial.prototype = {
        // 初始化
        _tutorialInit : function(){
            this._create();
        },
        _create : function(){
            if(!this.options.template){
                return;
            }
            this.template = $(this.options.template);
            this.template.css({
            	"position" : this.options.position,
                "width" : this.options.width,
                "height" : this.options.height,
                "top" : this.options.top,
                "right" : this.options.right
            }).show();
            this._bindEvents();
        },
        // 事件
        _event : {
            ".close click" : "_close" // 关闭
        },
        // 对 event 的处理，绑定事件
        _bindEvents : function(){
            var self = this;
            var myEvents = this._event;
            for(var i in myEvents){
                $(i.split(" ")[0]).bind(i.split(" ")[1],function(){
                    self[myEvents[i]].call(self,this);
                })
            }
        },
        // 关闭方法
        _close : function(self){
            $(this.template).remove();;
        }
    };
    module.exports = Tutorial;
});
